import request from '@/utils/request'

// 查询任务执行记录列表
export function listHistory(query) {
    return request({
        url: '/history/history/list',
        method: 'get',
        params: query
    })
}

// 查询任务执行记录详细
export function getHistory(recordId) {
    return request({
        url: '/history/history/' + recordId,
        method: 'get'
    })
}

// 新增任务执行记录
export function addHistory(data) {
    return request({
        url: '/history/history',
        method: 'post',
        data: data
    })
}

// 修改任务执行记录
export function updateHistory(data) {
    return request({
        url: '/history/history',
        method: 'put',
        data: data
    })
}

// 删除任务执行记录
export function delHistory(recordId) {
    return request({
        url: '/history/history/' + recordId,
        method: 'delete'
    })
}

// 导出KMZ文件
export function exportKmz(recordId) {
    return request({
        url: '/history/history/exportKmz/' + recordId,
        method: 'get',
        responseType: 'blob'
    })
}
